home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
272_01
/
smlibdl.doc
< prev
next >
Wrap
Text File
|
1987-08-15
|
27KB
|
991 lines
==========================
= STEVE'S LIBRARY =
= for Datalight =
= - by - =
= Steven E. Margison =
==========================
Functions and Documentation Copyright 1986 & 1987
by Steven E. Margison -- All Rights Reserved
ISBN 0-944267-06-8
--------- TABLE OF CONTENTS ---------
Introduction ................................. 1
The Documentation ............................ 1
Installation ................................. 2
Linking ...................................... 3
Interrupt Handler Functions .................. 4
Utilities ..... .............................. 5
On Buffering STDOUT .......................... 10
Shareware .................................... 11
Warranty ..................................... 12
Registration Form ............................ --
Steve's Function Library for Datalight C
I. INTRODUCTION
The heart of the C language is its library. Each
compiler has its own library of functions, which is complete
only to the degree that the compiler author wishes to make it.
The Datalight C Compiler is an excellent product which has
gotten rave reviews in computer magazines. (I have both Lattice
3.1 and Datalight available to me and I prefer the Datalight by
far.) The greatest criticism which can be leveled at Datalight
is the size of its library. It has all the usual basic
functions, plus some nice unique features. But it still can use
some help. Enter Steve's Library! At over 100 functions my
library greatly enhances program development with Datalight C.
II. THE DOCUMENTATION
The documentation for the library is contained in a
number of .DOC files, which describe each function. When
printed, these pages may be placed in a standard three-ring
binder. A utility program, PMAN.COM is provided to generate the
entire set of documents. PMAN requires the file LISTALL, which
may be edited to eliminate printing of certain files if desired.
(PMAN is copyrighted, but placed in the public domain.)
To print the DOC files, you must be in a directory (or
on a floppy) containing PMAN, LISTALL, and all the DOC files.
Just type "PMAN" at your system prompt and the files will be
printed to PRN:.
Steve's C Library for Datalight Page 1
III. INSTALLATION
Steve's Library is distributed as four library files for each
type of memory model. (Only the full registration with source
has all four libraries.) The filenames are:
SMDLS.LIB Small Memory Model
SMDLD.LIB Large Data Model
SMDLP.LIB Large Code Model
SMDLL.LIB Large Code and Data Model
For the remainder of this manual the libraries will be referred
to as SMDLx.LIB.
A typical hard disk installation of Datalight will consist of a
directory named \DC in which will be found the compiler,
Datalight libraries, and Datalight header files. SMDLx.LIB
should be copied into this directory as well, or into whatever
directory the Datalight libraries have been installed.
Steve's Library also includes several header files which list
"define"s for many useful items. These header files are also
required to re-compile the source for the libraries. The header
files should be copied into the \DC directory, or in whatever
other directory contains stdio.h, dos.h, and the other header
files. If you have purchased the source files and wish to have
them on hard disk, make a new subdirectory under the \DC main
directory called SM (C:\DC\SM) and copy all source files to that
directory.
Steve's C Library for Datalight Page 2
IV. LINKING
The SMDLx.LIB library must be linked with any other
libraries whenever a function is used in your program. Some
programs may not use SMDLx.LIB functions, and therefore the
linking of the library may be eliminated to save time. The
Datalight driver (DLC) command line would look like this:
DLC MYPROGRAM \DC\SMDLS.LIB
Naturally, if your directory structure is not the standard,
specify the paths as needed. In addition, if you have other
third party libraries, be sure to include them after SMDLx.LIB.
Steve's C Library for Datalight Page 3
V. INTERRUPT HANDLER FUNCTIONS
A special feature of Steve's Library is the various
interrupt handler functions. These are:
ticker
ctlbrk
criterr
These functions provide the programmer with the ability to
install a special routine to intercept one of the DOS
interrupts. ctlbrk() installs a user-defined routine to be
executed whenever a control-break is typed on the keyboard.
criterr() traps the DOS critical error handler (the one that
says Abort, Retry, etc.) and allows the programmer to substitute
his own handler. ticker() is not really a user definable
handler, but a pre-built handler which allows the user to
perform operations relative to the system's clock. A special
variable may be loaded with a value and then tested at
intervals. When the variable has hit zero, a specific amount of
time has passed. The variable counts 18.2 times per second, and
is installed on INT 1CH.
The usage of these interrupt handlers is slightly complex and
interactive. For example, if you use ticker() you must use
ctlbrk() and you may have to use criterr(). It has been said
that a picture is worth a thousand words. Well, to me, a source
file is worth a whole chapter of tutorial. Therefore, refer to
TESTINTS.C, which is supplied with all distributions of Steve's
Library , to see a heavily commented source code file which uses
these interrupts. This program may be compiled and run to watch
the result.
Steve's C Library for Datalight Page 4
VI. THE UTILITIES
Beginning with Release 1.20 of my library, I am shipping
the source code for several utiltiies I have written. Nothing
earth shaking here, just some convenient programs to make life a
little easier. All the programs use several functions